package com.huifaapp.mall.bean;

import android.util.Log;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/12/27.
 */

public class PayDetails {

        public static class Attr {
            public static final String POINTS = "points";
            public static final String POINTSAMOUNT = "pointsAmount";
            public static final String COUPONIDS="couponIds";
            public static final String COUPONAMOUNT="couponAmount";
            public static final String COUNT="count";
            public static final String TOTALAMOUNT="totalAmount";
            public static final String USERSADDRVO="usersAddrVo";
            public static final String SKUIDS="skuIds";
            public static final String GOODSLIST="goodsList";
            public static final String COUPONLIST="couponList";
            public static final String COMPAREAMOUNT="compareAmount";
            public static final String ISUSESYSCOUPON="isUseSysCoupon";
            public static final String ISUSEPOINT="isUsePoint";

        }
        public PayDetails() {

        }

        public PayDetails(int points, double pointsAmount, String couponIds, double couponAmount, int count,
                          double totalAmount, String usersAddrVo, String skuIds, String goodsList,String couponList,
                          double compareAmount,String isUseSysCoupon,String isUsePoint){
            super();
            this.points=points;
            this.pointsAmount=pointsAmount;
            this.couponIds=couponIds;
            this.couponAmount=couponAmount;
            this.count=count;
            this.totalAmount=totalAmount;
            this.usersAddrVo=usersAddrVo;
            this.skuIds=skuIds;
            this.goodsList=goodsList;
            this.couponList=couponList;
            this.compareAmount=compareAmount;
            this.isUseSysCoupon=isUseSysCoupon;
            this.isUsePoint=isUsePoint;
        }
        /**
         * points : 0
         * pointsAmount : 0.0
         * couponIds :
         * couponAmount : 0.0
         * count : 0
         * totalAmount : 175.0
         * usersAddrVo : {"receiverName":"黎明","receiverPhone":"15100012231","detail":"小区8号楼909","id":"977b3e2c48024a30bb0819b7259e063b"}
         * skuIds : 10001,10002
         * goodsList : [{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"山婆婆 黄桃水罐头","price":25,"orginPrice":18.8,"isSevenBack":"","goodsId":"10001","storeId":"1007","param":{"color":"white","brand":"泡泡堂"},"count":5},{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"盼盼蛋糕","price":25,"orginPrice":21,"isSevenBack":"","goodsId":"10002","storeId":"1007","param":{"color":"yellow","size":"xxl"},"count":2}]
         */

        private int points;
        private double pointsAmount;
        private String couponIds;
        private double couponAmount;
        private int count;
        private double totalAmount;
        private String usersAddrVo;
        private String skuIds;
        private String goodsList;
        private String couponList;
        private double compareAmount;
        private String isUseSysCoupon;
        private String isUsePoint;

    public String getIsUsePoint() {
        return isUsePoint;
    }

    public void setIsUsePoint(String isUsePoint) {
        this.isUsePoint = isUsePoint;
    }

    public String getIsUseSysCoupon() {
        return isUseSysCoupon;
    }

    public void setIsUseSysCoupon(String isUseSysCoupon) {
        this.isUseSysCoupon = isUseSysCoupon;
    }

    public double getCompareAmount() {
        return compareAmount;
    }

    public void setCompareAmount(double compareAmount) {
        this.compareAmount = compareAmount;
    }

    public String getCouponList() {
        return couponList;
    }

    public void setCouponList(String couponList) {
        this.couponList = couponList;
    }

    public int getPoints() {
            return points;
        }

        public void setPoints(int points) {
            this.points = points;
        }

        public double getPointsAmount() {
            return pointsAmount;
        }

        public void setPointsAmount(double pointsAmount) {
            this.pointsAmount = pointsAmount;
        }

        public String getCouponIds() {
            return couponIds;
        }

        public void setCouponIds(String couponIds) {
            this.couponIds = couponIds;
        }

        public double getCouponAmount() {
            return couponAmount;
        }

        public void setCouponAmount(double couponAmount) {
            this.couponAmount = couponAmount;
        }

        public int getCount() {
            return count;
        }

        public void setCount(int count) {
            this.count = count;
        }

        public double getTotalAmount() {
            return totalAmount;
        }

        public void setTotalAmount(double totalAmount) {
            this.totalAmount = totalAmount;
        }

        public String getUsersAddrVo() {
            return usersAddrVo;
        }

        public void setUsersAddrVo(String usersAddrVo) {
            this.usersAddrVo = usersAddrVo;
        }

        public String getSkuIds() {
            return skuIds;
        }

        public void setSkuIds(String skuIds) {
            this.skuIds = skuIds;
        }

        public String getGoodsList() {
            return goodsList;
        }

        public void setGoodsList(String goodsList) {
            this.goodsList = goodsList;
        }
        public static PayDetails newInstanceDetails(String json) {
            PayDetails bean = null;
            try {
                JSONObject obj = new JSONObject(json);
                if (obj.length() > 0) {
                    Log.e("tag", obj+"");
                    Integer points = obj.optInt(Attr.POINTS);
                    double pointsAmount=obj.getDouble(Attr.POINTSAMOUNT);
                    String couponIds=obj.getString(Attr.COUPONIDS);
                    double couponAmount=obj.getDouble(Attr.COUPONAMOUNT);
                    Integer count=obj.getInt(Attr.COUNT);
                    double totalAmount=obj.getDouble(Attr.TOTALAMOUNT);
                    String usersAddrVo=obj.getString(Attr.USERSADDRVO);
                    String skuIds=obj.getString(Attr.SKUIDS);
                    String goodsList=obj.getString(Attr.GOODSLIST);
                    String couponList=obj.getString(Attr.COUPONLIST);
                    double compareAmount=obj.getDouble(Attr.COMPAREAMOUNT);
                    String isUseSysCoupon=obj.getString(Attr.ISUSESYSCOUPON);
                    String isUsePoint=obj.getString(Attr.ISUSEPOINT);

                    bean = new PayDetails(points,pointsAmount,couponIds,couponAmount,count,totalAmount,usersAddrVo,skuIds,goodsList,couponList,compareAmount,isUseSysCoupon,isUsePoint);
                }
            } catch (JSONException e) {
                e.printStackTrace();
            }
            return bean;
        }







//    /**
//     * msg : 请求成功！
//     * code : 10000
//     * data : {"points":0,"pointsAmount":0,"couponIds":"","couponAmount":0,"count":0,"totalAmount":175,"usersAddrVo":{"receiverName":"黎明","receiverPhone":"15100012231","detail":"小区8号楼909","id":"977b3e2c48024a30bb0819b7259e063b"},"skuIds":"10001,10002","goodsList":[{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"山婆婆 黄桃水罐头","price":25,"orginPrice":18.8,"isSevenBack":"","goodsId":"10001","storeId":"1007","param":{"color":"white","brand":"泡泡堂"},"count":5},{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"盼盼蛋糕","price":25,"orginPrice":21,"isSevenBack":"","goodsId":"10002","storeId":"1007","param":{"color":"yellow","size":"xxl"},"count":2}]}
//     */
//
//    private String msg;
//    private String code;
//    private DataBean data;
//
//    public String getMsg() {
//        return msg;
//    }
//
//    public void setMsg(String msg) {
//        this.msg = msg;
//    }
//
//    public String getCode() {
//        return code;
//    }
//
//    public void setCode(String code) {
//        this.code = code;
//    }
//
//    public DataBean getData() {
//        return data;
//    }
//
//    public void setData(DataBean data) {
//        this.data = data;
//    }
//
//    public static class DataBean {
//        /**
//         * points : 0
//         * pointsAmount : 0.0
//         * couponIds :
//         * couponAmount : 0.0
//         * count : 0
//         * totalAmount : 175.0
//         * usersAddrVo : {"receiverName":"黎明","receiverPhone":"15100012231","detail":"小区8号楼909","id":"977b3e2c48024a30bb0819b7259e063b"}
//         * skuIds : 10001,10002
//         * goodsList : [{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"山婆婆 黄桃水罐头","price":25,"orginPrice":18.8,"isSevenBack":"","goodsId":"10001","storeId":"1007","param":{"color":"white","brand":"泡泡堂"},"count":5},{"goodsImg":"http://file.jhjvip.cn/images/default.jpg","goodsName":"盼盼蛋糕","price":25,"orginPrice":21,"isSevenBack":"","goodsId":"10002","storeId":"1007","param":{"color":"yellow","size":"xxl"},"count":2}]
//         */
//
//        private int points;
//        private double pointsAmount;
//        private String couponIds;
//        private double couponAmount;
//        private int count;
//        private double totalAmount;
//        private UsersAddrVoBean usersAddrVo;
//        private String skuIds;
//        private List<GoodsListBean> goodsList;
//
//        public int getPoints() {
//            return points;
//        }
//
//        public void setPoints(int points) {
//            this.points = points;
//        }
//
//        public double getPointsAmount() {
//            return pointsAmount;
//        }
//
//        public void setPointsAmount(double pointsAmount) {
//            this.pointsAmount = pointsAmount;
//        }
//
//        public String getCouponIds() {
//            return couponIds;
//        }
//
//        public void setCouponIds(String couponIds) {
//            this.couponIds = couponIds;
//        }
//
//        public double getCouponAmount() {
//            return couponAmount;
//        }
//
//        public void setCouponAmount(double couponAmount) {
//            this.couponAmount = couponAmount;
//        }
//
//        public int getCount() {
//            return count;
//        }
//
//        public void setCount(int count) {
//            this.count = count;
//        }
//
//        public double getTotalAmount() {
//            return totalAmount;
//        }
//
//        public void setTotalAmount(double totalAmount) {
//            this.totalAmount = totalAmount;
//        }
//
//        public UsersAddrVoBean getUsersAddrVo() {
//            return usersAddrVo;
//        }
//
//        public void setUsersAddrVo(UsersAddrVoBean usersAddrVo) {
//            this.usersAddrVo = usersAddrVo;
//        }
//
//        public String getSkuIds() {
//            return skuIds;
//        }
//
//        public void setSkuIds(String skuIds) {
//            this.skuIds = skuIds;
//        }
//
//        public List<GoodsListBean> getGoodsList() {
//            return goodsList;
//        }
//
//        public void setGoodsList(List<GoodsListBean> goodsList) {
//            this.goodsList = goodsList;
//        }
//
//        public static class UsersAddrVoBean {
//            /**
//             * receiverName : 黎明
//             * receiverPhone : 15100012231
//             * detail : 小区8号楼909
//             * id : 977b3e2c48024a30bb0819b7259e063b
//             */
//
//            private String receiverName;
//            private String receiverPhone;
//            private String detail;
//            private String id;
//
//            public String getReceiverName() {
//                return receiverName;
//            }
//
//            public void setReceiverName(String receiverName) {
//                this.receiverName = receiverName;
//            }
//
//            public String getReceiverPhone() {
//                return receiverPhone;
//            }
//
//            public void setReceiverPhone(String receiverPhone) {
//                this.receiverPhone = receiverPhone;
//            }
//
//            public String getDetail() {
//                return detail;
//            }
//
//            public void setDetail(String detail) {
//                this.detail = detail;
//            }
//
//            public String getId() {
//                return id;
//            }
//
//            public void setId(String id) {
//                this.id = id;
//            }
//        }
//
//        public static class GoodsListBean {
//            /**
//             * goodsImg : http://file.jhjvip.cn/images/default.jpg
//             * goodsName : 山婆婆 黄桃水罐头
//             * price : 25.0
//             * orginPrice : 18.8
//             * isSevenBack :
//             * goodsId : 10001
//             * storeId : 1007
//             * param : {"color":"white","brand":"泡泡堂"}
//             * count : 5
//             */
//
//            private String goodsImg;
//            private String goodsName;
//            private double price;
//            private double orginPrice;
//            private String isSevenBack;
//            private String goodsId;
//            private String storeId;
//            private ParamBean param;
//            private int count;
//
//            public String getGoodsImg() {
//                return goodsImg;
//            }
//
//            public void setGoodsImg(String goodsImg) {
//                this.goodsImg = goodsImg;
//            }
//
//            public String getGoodsName() {
//                return goodsName;
//            }
//
//            public void setGoodsName(String goodsName) {
//                this.goodsName = goodsName;
//            }
//
//            public double getPrice() {
//                return price;
//            }
//
//            public void setPrice(double price) {
//                this.price = price;
//            }
//
//            public double getOrginPrice() {
//                return orginPrice;
//            }
//
//            public void setOrginPrice(double orginPrice) {
//                this.orginPrice = orginPrice;
//            }
//
//            public String getIsSevenBack() {
//                return isSevenBack;
//            }
//
//            public void setIsSevenBack(String isSevenBack) {
//                this.isSevenBack = isSevenBack;
//            }
//
//            public String getGoodsId() {
//                return goodsId;
//            }
//
//            public void setGoodsId(String goodsId) {
//                this.goodsId = goodsId;
//            }
//
//            public String getStoreId() {
//                return storeId;
//            }
//
//            public void setStoreId(String storeId) {
//                this.storeId = storeId;
//            }
//
//            public ParamBean getParam() {
//                return param;
//            }
//
//            public void setParam(ParamBean param) {
//                this.param = param;
//            }
//
//            public int getCount() {
//                return count;
//            }
//
//            public void setCount(int count) {
//                this.count = count;
//            }
//
//
// public static class ParamBean {
//                /**
//                 * color : white
//                 * brand : 泡泡堂
//                 */
//
//                private String color;
//                private String brand;
//
//                public String getColor() {
//                    return color;
//                }
//
//                public void setColor(String color) {
//                    this.color = color;
//                }
//
//                public String getBrand() {
//                    return brand;
//                }
//
//                public void setBrand(String brand) {
//                    this.brand = brand;
//                }
//            }
//        }
//    }
}
